import request from '@/utils/request'

export default {
    // 讲师列表-条件分页查询
    // current 当前页  limit 煤业记录数  teacherQuery 条件对象
    getTeacherListPageCondition(current, limit, teacherQuery) {
        return request({
            // url: '/edu/teacher/pageTeacherCondition/'+ current + '/' + limit,
            url: `/edu/teacher/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            // 后端如果是json格式数据接收
            data: teacherQuery
        })
    },

    // 讲师表单添加接口
    save(teacher) {
        return request({
            url: `/edu/teacher/save`,
            method: 'post',
            // 后端如果是json格式数据接收
            data: teacher
        })
    },

    // 根据ID删除讲师接口
    removeById(teacherId) {
        return request({
            url: `/edu/teacher/${teacherId}`,
            method: 'delete'
        })
    },

    // 根据id查询讲师
    getById(id) {
        return request({
            url: `/edu/teacher/${id}`,
            method: 'get'
        })
    },

    // 修改讲师
    updateTeacher(teacher) {
        return request({
            url: `/edu/teacher/updateTeacher`,
            method: 'post',
            data: teacher
        })
    }
}